Optimal. Leaf size=207 \[ -\frac {(a+b x)^{1-n} (d e-c f) (e+f x)^{n-3}}{f (3-n) (b e-a f)}+\frac {(a+b x)^{1-n} (e+f x)^{n-2} (b (2 c f+d e (1-n))-a d f (3-n))}{f (2-n) (3-n) (b e-a f)^2}+\frac {b (a+b x)^{1-n} (e+f x)^{n-1} (b (2 c f+d e (1-n))-a d f (3-n))}{f (1-n) (2-n) (3-n) (b e-a f)^3} \]
________________________________________________________________________________________
Rubi [A] time = 0.12, antiderivative size = 205, normalized size of antiderivative = 0.99, number of steps used = 3, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {79, 45, 37} \begin {gather*} -\frac {(a+b x)^{1-n} (d e-c f) (e+f x)^{n-3}}{f (3-n) (b e-a f)}+\frac {(a+b x)^{1-n} (e+f x)^{n-2} (-a d f (3-n)+2 b c f+b d e (1-n))}{f (2-n) (3-n) (b e-a f)^2}+\frac {b (a+b x)^{1-n} (e+f x)^{n-1} (-a d f (3-n)+2 b c f+b d e (1-n))}{f (1-n) (2-n) (3-n) (b e-a f)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 37
Rule 45
Rule 79
Rubi steps
\begin {align*} \int (a+b x)^{-n} (c+d x) (e+f x)^{-4+n} \, dx &=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f) (3-n)}-\frac {(-2 b c f-d (b e (1-n)+a f (-3+n))) \int (a+b x)^{-n} (e+f x)^{-3+n} \, dx}{f (-b e+a f) (-3+n)}\\ &=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f) (3-n)}+\frac {(2 b c f+b d e (1-n)-a d f (3-n)) (a+b x)^{1-n} (e+f x)^{-2+n}}{f (b e-a f)^2 (2-n) (3-n)}-\frac {(b (-2 b c f-d (b e (1-n)+a f (-3+n)))) \int (a+b x)^{-n} (e+f x)^{-2+n} \, dx}{f (b e-a f) (-b e+a f) (2-n) (-3+n)}\\ &=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f) (3-n)}+\frac {(2 b c f+b d e (1-n)-a d f (3-n)) (a+b x)^{1-n} (e+f x)^{-2+n}}{f (b e-a f)^2 (2-n) (3-n)}+\frac {b (2 b c f+b d e (1-n)-a d f (3-n)) (a+b x)^{1-n} (e+f x)^{-1+n}}{f (b e-a f)^3 (1-n) (2-n) (3-n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.20, size = 180, normalized size = 0.87 \begin {gather*} \frac {(a+b x)^{1-n} (e+f x)^{n-3} \left (a^2 f (n-1) (c f (n-2)-d e+d f (n-3) x)+a b \left (2 c f (n-1) (f x-e (n-3))+d \left (e^2 (n-3)-2 e f \left (n^2-4 n+5\right ) x+f^2 (n-3) x^2\right )\right )+b^2 \left (c \left (e^2 \left (n^2-5 n+6\right )-2 e f (n-3) x+2 f^2 x^2\right )+d e (n-1) x (e (n-3)-f x)\right )\right )}{(n-3) (n-2) (n-1) (a f-b e)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.08, size = 0, normalized size = 0.00 \begin {gather*} \int (a+b x)^{-n} (c+d x) (e+f x)^{-4+n} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.48, size = 884, normalized size = 4.27 \begin {gather*} \frac {{\left (2 \, a^{3} c e f^{2} + {\left (b^{3} d e f^{2} + {\left (2 \, b^{3} c - 3 \, a b^{2} d\right )} f^{3} - {\left (b^{3} d e f^{2} - a b^{2} d f^{3}\right )} n\right )} x^{4} + 3 \, {\left (2 \, a b^{2} c - a^{2} b d\right )} e^{3} - {\left (6 \, a^{2} b c - a^{3} d\right )} e^{2} f + {\left (4 \, b^{3} d e^{2} f + 4 \, {\left (2 \, b^{3} c - 3 \, a b^{2} d\right )} e f^{2} + {\left (b^{3} d e^{2} f - 2 \, a b^{2} d e f^{2} + a^{2} b d f^{3}\right )} n^{2} - {\left (5 \, b^{3} d e^{2} f + 2 \, {\left (b^{3} c - 4 \, a b^{2} d\right )} e f^{2} - {\left (2 \, a b^{2} c - 3 \, a^{2} b d\right )} f^{3}\right )} n\right )} x^{3} + {\left (a b^{2} c e^{3} - 2 \, a^{2} b c e^{2} f + a^{3} c e f^{2}\right )} n^{2} + {\left (3 \, b^{3} d e^{3} - 9 \, a^{2} b d e f^{2} + 3 \, a^{3} d f^{3} + 3 \, {\left (4 \, b^{3} c - 3 \, a b^{2} d\right )} e^{2} f + {\left (b^{3} d e^{3} + {\left (b^{3} c - a b^{2} d\right )} e^{2} f - {\left (2 \, a b^{2} c + a^{2} b d\right )} e f^{2} + {\left (a^{2} b c + a^{3} d\right )} f^{3}\right )} n^{2} - {\left (4 \, b^{3} d e^{3} + {\left (7 \, b^{3} c - 4 \, a b^{2} d\right )} e^{2} f - 4 \, {\left (2 \, a b^{2} c + a^{2} b d\right )} e f^{2} + {\left (a^{2} b c + 4 \, a^{3} d\right )} f^{3}\right )} n\right )} x^{2} - {\left (3 \, a^{3} c e f^{2} + {\left (5 \, a b^{2} c - a^{2} b d\right )} e^{3} - {\left (8 \, a^{2} b c - a^{3} d\right )} e^{2} f\right )} n + {\left (6 \, b^{3} c e^{3} + 2 \, a^{3} c f^{3} + 6 \, {\left (a b^{2} c - 2 \, a^{2} b d\right )} e^{2} f - 2 \, {\left (3 \, a^{2} b c - 2 \, a^{3} d\right )} e f^{2} + {\left (a^{3} c f^{3} + {\left (b^{3} c + a b^{2} d\right )} e^{3} - {\left (a b^{2} c + 2 \, a^{2} b d\right )} e^{2} f - {\left (a^{2} b c - a^{3} d\right )} e f^{2}\right )} n^{2} - {\left (3 \, a^{3} c f^{3} + {\left (5 \, b^{3} c + 3 \, a b^{2} d\right )} e^{3} - {\left (a b^{2} c + 8 \, a^{2} b d\right )} e^{2} f - {\left (7 \, a^{2} b c - 5 \, a^{3} d\right )} e f^{2}\right )} n\right )} x\right )} {\left (f x + e\right )}^{n - 4}}{{\left (6 \, b^{3} e^{3} - 18 \, a b^{2} e^{2} f + 18 \, a^{2} b e f^{2} - 6 \, a^{3} f^{3} - {\left (b^{3} e^{3} - 3 \, a b^{2} e^{2} f + 3 \, a^{2} b e f^{2} - a^{3} f^{3}\right )} n^{3} + 6 \, {\left (b^{3} e^{3} - 3 \, a b^{2} e^{2} f + 3 \, a^{2} b e f^{2} - a^{3} f^{3}\right )} n^{2} - 11 \, {\left (b^{3} e^{3} - 3 \, a b^{2} e^{2} f + 3 \, a^{2} b e f^{2} - a^{3} f^{3}\right )} n\right )} {\left (b x + a\right )}^{n}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {{\left (d x + c\right )} {\left (f x + e\right )}^{n - 4}}{{\left (b x + a\right )}^{n}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.01, size = 505, normalized size = 2.44 \begin {gather*} \frac {\left (b x +a \right ) \left (a^{2} d \,f^{2} n^{2} x -2 a b d e f \,n^{2} x +a b d \,f^{2} n \,x^{2}+b^{2} d \,e^{2} n^{2} x -b^{2} d e f n \,x^{2}+a^{2} c \,f^{2} n^{2}-4 a^{2} d \,f^{2} n x -2 a b c e f \,n^{2}+2 a b c \,f^{2} n x +8 a b d e f n x -3 a b d \,f^{2} x^{2}+b^{2} c \,e^{2} n^{2}-2 b^{2} c e f n x +2 b^{2} c \,f^{2} x^{2}-4 b^{2} d \,e^{2} n x +b^{2} d e f \,x^{2}-3 a^{2} c \,f^{2} n -a^{2} d e f n +3 a^{2} d \,f^{2} x +8 a b c e f n -2 a b c \,f^{2} x +a b d \,e^{2} n -10 a b d e f x -5 b^{2} c \,e^{2} n +6 b^{2} c e f x +3 b^{2} d \,e^{2} x +2 a^{2} c \,f^{2}+a^{2} d e f -6 a b c e f -3 a b d \,e^{2}+6 b^{2} c \,e^{2}\right ) \left (b x +a \right )^{-n} \left (f x +e \right )^{n -3}}{a^{3} f^{3} n^{3}-3 a^{2} b e \,f^{2} n^{3}+3 a \,b^{2} e^{2} f \,n^{3}-b^{3} e^{3} n^{3}-6 a^{3} f^{3} n^{2}+18 a^{2} b e \,f^{2} n^{2}-18 a \,b^{2} e^{2} f \,n^{2}+6 b^{3} e^{3} n^{2}+11 a^{3} f^{3} n -33 a^{2} b e \,f^{2} n +33 a \,b^{2} e^{2} f n -11 b^{3} e^{3} n -6 a^{3} f^{3}+18 a^{2} b e \,f^{2}-18 a \,b^{2} e^{2} f +6 b^{3} e^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {{\left (d x + c\right )} {\left (f x + e\right )}^{n - 4}}{{\left (b x + a\right )}^{n}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.48, size = 869, normalized size = 4.20 \begin {gather*} \frac {x\,{\left (e+f\,x\right )}^{n-4}\,\left (d\,a^3\,e\,f^2\,n^2-5\,d\,a^3\,e\,f^2\,n+4\,d\,a^3\,e\,f^2+c\,a^3\,f^3\,n^2-3\,c\,a^3\,f^3\,n+2\,c\,a^3\,f^3-2\,d\,a^2\,b\,e^2\,f\,n^2+8\,d\,a^2\,b\,e^2\,f\,n-12\,d\,a^2\,b\,e^2\,f-c\,a^2\,b\,e\,f^2\,n^2+7\,c\,a^2\,b\,e\,f^2\,n-6\,c\,a^2\,b\,e\,f^2+d\,a\,b^2\,e^3\,n^2-3\,d\,a\,b^2\,e^3\,n-c\,a\,b^2\,e^2\,f\,n^2+c\,a\,b^2\,e^2\,f\,n+6\,c\,a\,b^2\,e^2\,f+c\,b^3\,e^3\,n^2-5\,c\,b^3\,e^3\,n+6\,c\,b^3\,e^3\right )}{{\left (a\,f-b\,e\right )}^3\,{\left (a+b\,x\right )}^n\,\left (n^3-6\,n^2+11\,n-6\right )}+\frac {x^2\,{\left (e+f\,x\right )}^{n-4}\,\left (d\,a^3\,f^3\,n^2-4\,d\,a^3\,f^3\,n+3\,d\,a^3\,f^3-d\,a^2\,b\,e\,f^2\,n^2+4\,d\,a^2\,b\,e\,f^2\,n-9\,d\,a^2\,b\,e\,f^2+c\,a^2\,b\,f^3\,n^2-c\,a^2\,b\,f^3\,n-d\,a\,b^2\,e^2\,f\,n^2+4\,d\,a\,b^2\,e^2\,f\,n-9\,d\,a\,b^2\,e^2\,f-2\,c\,a\,b^2\,e\,f^2\,n^2+8\,c\,a\,b^2\,e\,f^2\,n+d\,b^3\,e^3\,n^2-4\,d\,b^3\,e^3\,n+3\,d\,b^3\,e^3+c\,b^3\,e^2\,f\,n^2-7\,c\,b^3\,e^2\,f\,n+12\,c\,b^3\,e^2\,f\right )}{{\left (a\,f-b\,e\right )}^3\,{\left (a+b\,x\right )}^n\,\left (n^3-6\,n^2+11\,n-6\right )}+\frac {a\,e\,{\left (e+f\,x\right )}^{n-4}\,\left (-d\,a^2\,e\,f\,n+d\,a^2\,e\,f+c\,a^2\,f^2\,n^2-3\,c\,a^2\,f^2\,n+2\,c\,a^2\,f^2+d\,a\,b\,e^2\,n-3\,d\,a\,b\,e^2-2\,c\,a\,b\,e\,f\,n^2+8\,c\,a\,b\,e\,f\,n-6\,c\,a\,b\,e\,f+c\,b^2\,e^2\,n^2-5\,c\,b^2\,e^2\,n+6\,c\,b^2\,e^2\right )}{{\left (a\,f-b\,e\right )}^3\,{\left (a+b\,x\right )}^n\,\left (n^3-6\,n^2+11\,n-6\right )}+\frac {b^2\,f^2\,x^4\,{\left (e+f\,x\right )}^{n-4}\,\left (2\,b\,c\,f-3\,a\,d\,f+b\,d\,e+a\,d\,f\,n-b\,d\,e\,n\right )}{{\left (a\,f-b\,e\right )}^3\,{\left (a+b\,x\right )}^n\,\left (n^3-6\,n^2+11\,n-6\right )}+\frac {b\,f\,x^3\,{\left (e+f\,x\right )}^{n-4}\,\left (4\,b\,e+a\,f\,n-b\,e\,n\right )\,\left (2\,b\,c\,f-3\,a\,d\,f+b\,d\,e+a\,d\,f\,n-b\,d\,e\,n\right )}{{\left (a\,f-b\,e\right )}^3\,{\left (a+b\,x\right )}^n\,\left (n^3-6\,n^2+11\,n-6\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________